<%--
  Created by IntelliJ IDEA.
  User: LENOVO
  Date: 2018/4/29
  Time: 17:58
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>次页面求和</title>
</head>
<body>
<%
    String str= request.getParameter("computer");//获取值
    int n=Integer.parseInt(str);
    int sum =0 ;
    for(int i=1;i<=n;i++){
        sum =sum +i ;  }
%>
<P>从1到<%=n%>的连续和是: </p><br>
        <%= sum%>
</body>
</html>
